﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_GetTaskPeriod]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_GetTaskPeriod];
GO
CREATE PROCEDURE [dbo].[sproc_GetTaskPeriod]
    @TaskID int,
    @Date datetime,
             @Username nvarchar(20)
           
As

Select PeriodID
    FROM UDS_Schedule
    WHERE Username=@Username and [date]=@Date and TaskID=@TaskID